package com.vm.osm.business.dao;

import com.vm.osm.business.dto.req.failOrder.ReqSearchFailureOrder;
import com.vm.osm.business.dto.req.orderInst.ReqGetMyOrder;
import com.vm.osm.business.dto.rsp.failOrder.FailOrderPage;
import com.vm.osm.business.dto.rsp.failOrder.RspFailOrderDetail;
import com.vm.osm.business.dto.rsp.orderInst.AppOrderList;
import com.vm.osm.business.dto.rsp.orderInst.Maintenance;
import com.vm.osm.business.dto.rsp.orderInst.OrderInfo;
import com.vm.osm.business.entity.OsmOrderFailure;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * Created by chenzui on 2018/3/13.
 */
public interface OsmOrderFailureMapper extends BaseDao<OsmOrderFailure,String> {
    public List<FailOrderPage> queryOrderFailureByCond(ReqSearchFailureOrder reqSearchFailureOrder);

    public RspFailOrderDetail queryOrderFailureById(@Param("id") String id);

    public List<OrderInfo> queryMyOrders(ReqGetMyOrder reqGetMyOrder);

    public List<FailOrderPage> queryOrderFailureByStaffId(@Param("staffId") String staffId);

    /**
     * 按条件查询单个
     *
     * @param params 查询条件
     * @return 记录
     */
    OsmOrderFailure get(Map<String, Object> params);

    public List<FailOrderPage> queryOrderFailureByDepartment(ReqGetMyOrder reqGetMyOrder);

    /**
     *
     * @param deviceId
     * @return
     */
    public List<Maintenance> queryOrderByDeviceId(@Param("deviceId") String deviceId);

    /**
     * 查询某个员工各类状态的故障单数量
     * @param staffId
     * @return
     */
    public List<Map<String,Long>> queryStatus(@Param("staffId") String staffId);

    /**
     *
     * @param staffId
     * @return
     */
    public Long queryCatch(@Param("staffId") String staffId);

    public List<Map<String,Long>> queryStatusByDept(@Param("departmentId") String departmentId,@Param("enterpriseId") String enterpriseId);

    public List<OrderInfo> queryMyFailOrders(ReqGetMyOrder reqGetMyOrder);


    public OsmOrderFailure selectByOutId(@Param("id") String id);

    /**
     * 查询我的工单列表
     * @param staffId
     * @param enterpriseId
     * @param type
     * @return
     */
    public List<AppOrderList> queryAppMyOrder(@Param("staffId") String staffId,@Param("enterpriseId") String enterpriseId,@Param("type") String type);


    public List<AppOrderList> queryAppDepartmentOrder(@Param("enterpriseId") String enterpriseId,@Param("status") String[] status);

    public OsmOrderFailure queryOutOrderByNbr(@Param("orderNbr") String orderNbr);
}
